#pragma once

#include "CoreCommon.h"
#include "MathCommon.h"
#include "Vector4.h"

LOCO_BEGIN


/// This struct is a POD
struct LOCO_CORE_API Matrix4
{
	// attributes
	float m[4][4];

	// static constants
	static const Matrix4 identity;

	// Methods
	Matrix4() = default;
	Matrix4(Matrix4 const& in) = default;
	Matrix4(Vector4 const& column0, Vector4 const& column1, Vector4 const& column2, Vector4 const& column3);
	Matrix4(float m00, float m01, float m02, float m03,
		float m10, float m11, float m12, float m13,
		float m20, float m21, float m22, float m23,
		float m30, float m31, float m32, float m33);

	Matrix4 operator+(Matrix4 const& in) const;
	Matrix4 operator-(Matrix4 const& in) const;
	Matrix4 operator*(Matrix4 const& in) const;
	Vector4 operator*(Vector4 const& in) const;
	Matrix4& operator*=(Matrix4 const& in);
	bool operator==(Matrix4 const& in) const;
	bool operator!=(Matrix4 const& in) const;

	Matrix4 transpose() const;
	float determinant() const;
	Matrix4 inverse() const;

	static bool near_equal(Matrix4 const& a, Matrix4 const& b, float delta = DELTA);
};

// inline defintions
#include "Matrix4.inl"

LOCO_END


